<?php
//$this->breadcrumbs=array(
//	'Nhân vật: ' . $model->nickname,
//);
//
//$this->pageTitle = $model->seotool->title;
//$this->pageDescription = $model->seotool->description;
//$this->pageKeywords = $model->seotool->keywords;
//$this->pageCanonical = array('/Events/artists/view', array('slug'=>$model->url));
//$this->pageRobotsFollow = 'follow';
//
//$this->pageFacebook=array(
//    'og:title'=>$model->seotool->title,
//    'og:author'=>SITE_AUTHOR,
//    'og:type'=>'article',
//    'og:image'=>'artists/' . date('Ymd', strtotime($model->createddate)) . '/' . $model->image,
//    'og:url'=>array('/Events/artists/view', array('slug'=>$model->url)),
//    'og:description'=>$model->seotool->description,
//    'og:locale'=>'vi_VN',
//);
?>
<div class="row">
    <div class="col-xs-9 col-left">  
        <h1 class="event-title">Đơn vị-tổ chức: <?php echo $model->title ?></h1>
        <div class="row">
            <div class="col-xs-12">
                <h1 class="event-title">Danh sách các sự kiện tiêu biểu của đơn vị</h1>
                <div class="event-primary">  
                    <?php                   
                    foreach ($model->EventOrganizers as $key => $value) { 
                        if( isset($value->contents) ){
                            $str_event_content = substr($value->contents->description, 0, 500 );                            
                        }else{
                            $str_event_content = null;
                        }
                        $startdate = $value->events->startdate;
                        $enddate = $value->events->enddate;
                        $numviews = $value->events->numviews;
                        $title = $value->events->title;
                        $url = $value->events->url;
                        $posteddate = $value->events->posteddate;
                        $time = '( từ ' . date("H:i:s", strtotime($startdate)) . ' ngày ' . date("d-m-Y", strtotime($startdate)) . ' đến ' . date("H:i:s", strtotime($enddate)) . ' ngày ' . date("d-m-Y", strtotime($enddate)) . ')';
                        ?>
                        <div class="event-body" style="border-bottom: solid #ccc 1px; padding: 0px 0px 20px 0px;">
                            <div class="event-image text-center"></div>
                            <div class="event-content"> 
                                <div class="row">
                                    <div class="col-xs-12" style="font-weight: bold">
                                        <?php echo CHtml::link($title, array('../su-kien-'.$value->categories->event_cate->url.'/'.$url)); ?>                                                                          
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="col-xs-12">
                                        <?php echo $time; ?>
                                    </div>
                                </div>
                                <div class="row">
                                    <div class="col-xs-12" style="font-weight: 100; margin: 10px 0px 0px 0px;">
                                        <?php echo strip_tags($str_event_content); ?>
                                    </div>
                                </div>                                 
                            </div>
                        </div>
                    <?php } ?>
                    <!-- Event Social -->
                    <h3 class="event-share">Chia sẻ và bình luận</h3>
                    <div class="event-social">
                        <div class="event-social-item">
                            <div class="fb-like" data-href="<?php //echo Yii::app()->createAbsoluteUrl('/Events/artists/view',array('slug'=>$model->url));  ?>" data-width="450" data-layout="button_count" data-show-faces="true" data-send="false"></div>
                        </div>
                        <div class="event-social-item">
                            <a href="https://twitter.com/NEXTTOPEVENT" class="twitter-follow-button" data-show-count="false" data-lang="en">Follow</a>
                        </div>
                        <div class="event-social-item">
                            <g:plusone annotation="bubble" size="medium"></g:plusone>
                        </div>
                        <div class="clear"></div>
                    </div>
                    <!-- Event Facebook Comment -->
                    <div class="fb-comments" data-href="<?php //echo Yii::app()->createAbsoluteUrl('/Events/artists/view',array('slug'=>$model->url));  ?>" data-width="683"></div>
                </div>            
            </div>       
        </div>
    </div>
    <div class="col-xs-3 col-left">       
        <?php $this->widget('EventPopular'); ?>        
        <?php $this->widget('NewsPopular'); ?>        
    </div>
</div>